<?php

namespace app\admin\validate;

use think\Validate;

class SourceMaterialConfig extends Validate
{
    //字段规则
    protected $rule = [
        'title' => 'require',
        'content' => 'require',
        'primary_classification' => 'require',
        'secondary_classification' => 'require',
    ];

    //验证器提示信息
    protected $message = [
        'title.require' => '请输入弹窗标题',
        'content.unique' => '请输入弹窗内容',
        'primary_classification.unique' => '请选择一级分类',
        'secondary_classification.unique' => '请选择二级分类'
    ];

    //使用场景
    protected $scene = [
        'add' => ['title', 'content', 'primary_classification', 'secondary_classification'],
        'edit' => ['title', 'content', 'primary_classification', 'secondary_classification'],
    ];
}